using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Decisions.HL7.Message;
using DecisionsFramework;

namespace Decisions.HL7.Message
{
    public class CycleTypeAttribute:RuleAttribute
    {
        private Dictionary<HL7Version, string[]> validVersionCodes = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, string[]> validVersionDescriptions = new Dictionary<HL7Version, string[]>();
        private Dictionary<HL7Version, HL7TableType> tableVersionTypes = new Dictionary<HL7Version, HL7TableType>();

        public CycleTypeAttribute()
        {
            // init the values for table version types
						tableVersionTypes[HL7Version.v26] = HL7TableType.User;
						tableVersionTypes[HL7Version.v27] = HL7TableType.User;
			
            
			// init the values for version codes
						validVersionCodes[HL7Version.v26] = new string[]{"FLS","PRV","GRV","LQD","EXP","DRT","DRW","THR","ISO","BWD","LKT","WFP","SFP","CMW","PEA","EOH","EOL","CRT","UTL","IST","GLS","PLA","ANR","GTL","OPW","BDP","TRB","GNP","COD","RNS","2RS","DEC"};
						validVersionCodes[HL7Version.v27] = new string[]{"FLS","PRV","GRV","LQD","EXP","DRT","DRW","THR","ISO","BWD","LKT","WFP","SFP","CMW","PEA","EOH","EOL","CRT","UTL","IST","GLS","PLA","ANR","GTL","OPW","BDP","TRB","GNP","COD","RNS","2RS","DEC"};
			
			// init the values for version descriptions
						validVersionDescriptions[HL7Version.v26] = new string[]{"Flash","Prevac","Gravity","Liquid","Express","Dart","Dart Warm-up Cycle","Thermal","Isothermal","Bowie-Dick Test","Leak Test","Wrap/Steam Flush Pressure Pulse (Wrap/SFPP)","Steam Flush Pressure Pulse","Chemical Wash","Peracetic Acid","EO High Temperature","EO Low Temperature","Cart Wash","Utensil Wash","Instrument Wash","Glassware","Plastic Goods Wash","Anesthesia/Respiratory","Gentle","Optional Wash","Bedpans","Tray/Basin","Gen. Purpose","Code","Rinse","Second Rinse","Decontamination"};
						validVersionDescriptions[HL7Version.v27] = new string[]{"Flash","Prevac","Gravity","Liquid","Express","Dart","Dart Warm-up Cycle","Thermal","Isothermal","Bowie-Dick Test","Leak Test","Wrap/Steam Flush Pressure Pulse (Wrap/SFPP)","Steam Flush Pressure Pulse","Chemical Wash","Peracetic Acid","EO High Temperature","EO Low Temperature","Cart Wash","Utensil Wash","Instrument Wash","Glassware","Plastic Goods Wash","Anesthesia/Respiratory","Gentle","Optional Wash","Bedpans","Tray/Basin","Gen. Purpose","Code","Rinse","Second Rinse","Decontamination"};
			            

        }

        
        public override ValidationIssue[] RunRule(string name, object owningObject, object value)
        {
            //todo: check if the value is valid in the current version
            //if the value is not valid in the current version, add it as a validation issue


            return new ValidationIssue[0];
        }
    }
}
